package com.xcm.service;

import com.alibaba.fastjson.JSONObject;
import com.xcm.exception.ServiceException;
import com.xcm.model.TbDeviceGroup;
import com.xcm.model.dto.DeviceGroupListDTO;
import com.xcm.model.dto.DeviceGroupTreeListDTO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface DeviceGroupService {
	/**
	 * 所有终端分组列表
	 *
	 * @return List<DeviceGroupListDTO>
	 */
	List<DeviceGroupListDTO> listAllDeviceGroup();

	/**
	 * 保存终端分组
	 *
     * @param deviceGroup TbDeviceGroup类型对象
     * @param user
     * @param request
     */
	void saveDeviceGroup(TbDeviceGroup deviceGroup, JSONObject user, HttpServletRequest request) throws ServiceException;

	/**
	 * 更新终端分组
	 *
     * @param deviceGroup TbDeviceGroup类型对象
     * @param user
     * @param request
     */
	void updateDeviceGroup(TbDeviceGroup deviceGroup, JSONObject user, HttpServletRequest request) throws ServiceException;

	/**
	 * 获取终端分组
	 *
	 * @param deviceGroupId 终端分组ID
	 */
	TbDeviceGroup getDeviceGroup(Long deviceGroupId);

	/**
	 * 删除终端分组
     * @param deviceGroupId 终端分组ID
* @param groupName
     * @param groupCode
     * @param user
     * @param request
     */
	void deleteDeviceGroup(Long deviceGroupId, String groupName, String groupCode, JSONObject user, HttpServletRequest request);

	/**
	 * 通过父ID获取终端分组列表
	 *
	 * @param parentId 父ID
	 * @return List<TbDeviceGroup>
	 */
	List<TbDeviceGroup> listDeviceGroupByParentId(Long parentId);

	/**
	 * 所有终端树形分组列表
	 *
	 * @return List<DeviceGroupTreeListDTO>
	 */
	List<DeviceGroupTreeListDTO> listAllDeviceGroupTree();

	/**
	 * 移动终端到分组
	 * @param groupCode 分组码
	 * @param deviceInfoIds    终端id
	 * @param user
	 * @param request
	 */
    void moveDeviceGroup(String groupCode, String deviceInfoIds, JSONObject user, HttpServletRequest request) throws ServiceException;
}
